Variables allow you
to access a whole slew of extended functionality within Portal©. Variables are used in many aspects in the
program and act similar to nicknames.
They must be declared in this screen, and once created, are open for use
to the entire program.
A common use of
variables is to use them in commands, like typed text, alias commands etc. To do so, you would take the name of the
variable (such as “potions”) and put the @ symbol before it. When you do so, the current value of
“potions” whatever it is, will replace the usage. So, if I was using potions to track the number of potions I had
(let’s say it’s 8 right now), if I then typed “say I have @potions potions” it
would replace “@potions” with 8. This
is similar to nicknames except that the variables do not need spaces before or
after. You could do “say
@potions@potions@potions” and it would come out like “say 888”
Variables can be
manipulated to almost any extent using the variable processing functionality of
Portal©. For more details on this
functionality, please refer to the Using Variables help file.
Note: Especially when
used with events, variables are
extremely versatile and very easy to use.
Part of this comes with the fact that you do not have to declare one as
either a string or a number (integer).
The program is smart enough to figure out what you’re trying to do with
the variable and it knows whether to process it as a string or an integer. The price to pay for this level of
convenience is that variable names cannot be extended or shortened versions of
existing variable names. For example,
you can have the variable “potions” but you could not add another variable
named “potions2” Basically, if you
really need to have 2 variables like this, name the first one “potions1”
Variable Maintenance Screen Elements
Variables Grid
This grid displays
all variables you have declared, as well as their initialization status. The Initialization status of a variable is
what the variable will be set to on each connection to the MUD. There are two other special instructions to
the program to tell it how to initialize a variable.
Initialization Status
<do
not initialize> Save the
variable’s value between program usages
<clear
on login> Clears the variable
to nil upon login
Delete Variable
Button
Deletes the
variable currently selected in the Variables Grid.
Note: You cannot delete
any variable that is currently being populated by any event. Also, if you open the Variable Maintenance
screen from the Select Variables screen, you will not be able to delete any
variables.
New Variable Field
Enter a new
variable you wish to declare here.
Pressing enter while in this field will automatically press the Variable
Color button. Variables must adhere to
the following guidelines.
·
Variables must contain only alphanumeric characters (a, b, c, 1, 2, 3,
etc.)
·
Variables must be in lower case
·
Variables cannot be longer than 25 characters
·
Variable names cannot be extended or shortened version of existing
variables.
Sets the
initialization status of the variable.
This follows the variable initialization as described above.
Initialization Status
Clear
on Login
Clears the variable to
nil every login (not re-execution of Portal©)
Do
not Initialize
Saves the value
of the variable across every login
Value
Initializes the
variable to the value you specify every login
Add Variable Button
Attempts to add the
new variable. If you enter an invalid
variable name, you will be notified.
Value Field
Enter a value here
that you can then assign to the variable currently selected in the Variables
Grid.
Set Variable Button
Sets the currently selected variable (in the Variables Grid) with the value in the Value Field.
Variable Button
Brings up the Variable Grabber screen. While you wouldn't "grab" anything at this time, it is useful to preuse the current values of the various variables.
Close Button
Closes the Variable
Maintenance Screen.